﻿
CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here. For example:
	// config.language = 'zh-cn';
	// config.uiColor = '#AADC6E';
	
	config.skin = 'moono';
	config.toolbarCanCollapse = false;
	config.autoUpdateElement = true;
	config.autoGrow_onStartup = false;
	config.resize_enabled = false;
	config.enterMode = CKEDITOR.ENTER_P;
	config.templates_replaceContent = false;


    config.filebrowserUploadUrl = BASEURL+'/uploadfiles/upload?no_db=1&no_thumb=1&return=ckeditor';  
    config.filebrowserImageUploadUrl = BASEURL+'/uploadfiles/upload?type=images&no_db=1&no_thumb=1&return=ckeditor';  
    config.filebrowserFlashUploadUrl = BASEURL+'/uploadfiles/upload?type=flashes&no_db=1&no_thumb=1&return=ckeditor';
    config.filebrowserFlvPlayerUploadUrl = BASEURL+'/uploadfiles/upload?type=videos&no_db=1&no_thumb=1&return=ckeditor';
    
	config.toolbar = 'FRONT';
	//config.height = 500;
	config.toolbar_Full =
	[
	    ['Source','-','Save','NewPage','Preview','-','Templates'],
	    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
	    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
	    ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
	    '/',
	    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
	    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
	    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
	    ['BidiLtr', 'BidiRtl'],
	    ['Link','Unlink','Anchor'],
	    ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
	    '/',
	    ['Styles','Format','Font','FontSize'],
	    ['TextColor','BGColor'],
	    ['Maximize', 'ShowBlocks','-','About']
	];
	
	config.toolbar_FRONT =
	[
	    ['Bold','Italic','Underline','Strike','-','TextColor','BGColor','RemoveFormat','-',],
	    ['NumberedList','BulletedList','Blockquote','JustifyLeft','JustifyCenter','-'],
	    ['Preview','Image','Table','HorizontalRule','SpecialChar'] ,
	    ['Undo','Redo','-','Replace'],
	    '/',
	    ['Font','Format','FontSize'],
	    ['Cut','Copy','Paste','PasteText','PasteFromWord'],
	    ['Maximize', 'ShowBlocks','-','Source','About']	    
	];


	config.toolbar_ANONY =
	[
	    ['Bold','Italic','Underline','-','TextColor','BGColor','RemoveFormat','-',],
	    ['NumberedList','BulletedList','JustifyLeft','JustifyCenter','-'],
	    ['Table','HorizontalRule','SpecialChar'] ,
	    '/',
	    ['Source','Preview','-','Font','Format','FontSize']
	];

	config.format_p = { element: 'p', styles: { 'text-indent': '2em' } };

	config.font_names = '宋体;微软雅黑;黑体;楷体;隶书;Arial;Times New Roman;Verdana;Comic Sanc MS;Courier New;';

	config.font_defaultLabel = '宋体';

	config.fontSize_defaultLabel = '14px';

	config.fontSize_sizes ='12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;'


	config.allowedContent = {
		img: {
	        attributes: [ 'src', 'alt', 'width', 'height' ],
	        classes: { tip: true },
	    },
	    audio:{
	    	attributes: [ 'src','controls','autoplay','loop'],
	    	style:true,
	    },
	    $1: {
	        // Use the ability to specify elements as an object.
	        elements: CKEDITOR.dtd,
	        attributes: 'data-ct', //ct:color type。 data-ct=fix固定颜色
	        styles: true,
	    }
	};

	config.disallowedContent = 'script;link;a;style; *[on*]';

	/*
	CKEDITOR.stylesSet.add( 'miao_styles', [
	    // Block-level styles
	    { name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue','background-color':'#fff',
	    	'border-left':'5px solid  #666' } },
	    { name: 'Red Title' , element: 'h3', styles: { 'color': 'Red' } },
	    { name:'block',element:'h3',styles:{'color':'#FFF','background-color':'#373939','border-radius':'4px',
	    	'margin':'5px 0px 0px','padding':'10px','font-family':'arial, helvetica, sans-serif',
	    	'box-shadow':'2px 2px 4px #999','border-left':'10px solid #fdd000'}},

	    // Inline styles
	    // { name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } },
	    { name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } }
	] );
	config.stylesSet = 'miao_styles';

	
	{
    name: 'Name displayed in the Styles drop-down list',
    element: 'HTML element name (for example "span")',
    styles: {
        'css-style1': 'desired value',
        'css-style2': 'desired value',
        ...
    }
    attributes: {
        'attribute-name1': 'desired value',
        'attribute-name2': 'desired value',
        ...
    }
}
	*/
	
};


